package com.ledong.se.string;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

public class TestURLEncodig {
    public static void main(String[] args) throws UnsupportedEncodingException {
        testEncoding("");
    }

    public static void testEncoding(String str) throws UnsupportedEncodingException {
        String mytext = URLEncoder.encode("中国", "utf-8");
        String mytext2 = URLDecoder.decode(mytext, "utf-8");
        System.out.println(mytext);
        System.out.println(mytext2);
    }

}
